import request from './http';

/**
 * 文件监控表 前端接口
 */
export default class TableFileApi {
  static page(data: TableFile) {
    let { index, size, ...vo } = data;
    return request.post(`/tableFile/page/${index}/${size}`, vo);
  }

  static save(data: TableFile) {
    return request.post<TableFile>('/tableFile', data);
  }

  static update(data: TableFile) {
    return request.put<TableFile>('/tableFile', data);
  }

  static delete(ids: number[]) {
    return request.post('/tableFile/delete', ids);
  }

  static list(data: TableFile) {
    return request.post('/tableFile/list', data);
  }

  static getById(id: number) {
    return request.get(`/tableFile/get/${id}`);
  }

  static reqAi(id: number) {
    return request.get(`/tableFile/reqAi/${id}`);
  }

  static getFile(path: string) {
    return request.getBlob(`/file?file=${path}`);
  }

}
